package com.huangssssx.brick
{
	import com.huangssssx.loader.ILoader;
	import com.huangssssx.loader.ImageLoader;
	import com.huangssssx.loader.ResManager;
	
	import flash.display.Bitmap;
	import flash.display.Sprite;
	import flash.events.Event;

	public class FootHold extends Sprite
	{
		private var _backImageName:String;
		
		public function FootHold(backImageName:String)
		{
			_backImageName = backImageName;
			this.addEventListener(Event.ADDED,init);
		}
		
		private function init(event:Event):void
		{
			
			this.removeEventListener(Event.ADDED,init);
			var loader:ILoader = new ImageLoader();
			loader.load(_backImageName,function():void{
				var image:Bitmap = ResManager.getInstance().getRes(ResManager.RESOURCE_IMAGE,_backImageName) as Bitmap;
				graphics.beginBitmapFill(image.bitmapData);
				graphics.drawRect(0,0,image.width,image.height);
				graphics.endFill();
			});
		}
	}
}